/* eslint-disable prettier/prettier */
import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  HttpStatus,
  HttpCode,
} from '@nestjs/common';
import { UsersService } from './users.service';
import { CreateUserDto } from './dto/create-user.dto';
import { UpdateUserDto } from './dto/update-user.dto';
import {
  ApiBody,
  ApiCreatedResponse,
  ApiOperation,
  ApiResponse,
  ApiTags,
} from '@nestjs/swagger';
import SysUser from '../../entities/users/sys-user.entity';

@ApiTags('用户模块')
@Controller('users')
export class UsersController {
  constructor(private readonly usersService: UsersService) {}

  @Post('/register')
  // @HttpCode(200)
  @ApiOperation({
    summary: '创建新用户',
    description: '用于创建一个新的用户',
  })
  @ApiBody({
    description: '用户信息',
    type: CreateUserDto,
  })
  @ApiResponse({
    status: HttpStatus.OK,
    description: '成功创建用户',
    type: SysUser,
  })
  createUser(@Body() createUserDto: CreateUserDto) {
    return this.usersService.createUser(createUserDto);
  }

  @Get('/ceshi')
  ceshi() {
    return this.usersService.ceshi();
  }
  // @Post('/login')
  // @ApiOperation({
  //   summary: '用户登录',
  //   description: '用于用户登录',
  // })
  // @ApiBody({
  //   description: '用户信息',
  //   type: CreateUserDto,
  // })
  // @ApiCreatedResponse({
  //   description: '用户登录成功',
  //   type: SysUser,
  // })

  // userLogin(@Body() createUserDto: CreateUserDto) {
  //   return this.usersService.userLogin(createUserDto)
  // }
}
